function chaves = randstring (max, min, repet)
pet = 0;
    while pet ~= repet
        pet = pet + 1;
          size = floor((max+1-min)*rand()+min); %Como o floor arredonda para baixo, se fizesse com (20-3) nunca poderia sair 20
          string="";
          for i=0 : size
            U=rand();
            if(U<0.5)
              string=strcat(string,char(floor((91-65)*rand()+65)));
            else
              string=strcat(string,char(floor((121-97)*rand()+97)));
            end
         
          end
          chaves{pet} = string(1,1);
          pet = length(chaves);
    end
end